package mutsumimod.powers;

import com.evacipated.cardcrawl.modthespire.lib.SpirePatch;
import com.evacipated.cardcrawl.modthespire.lib.SpirePostfixPatch;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.rooms.AbstractRoom;
import mutsumimod.cards.custom.HeartWall;

import java.lang.reflect.Field;

import static mutsumimod.MutsumiMod.makeID;


public class HeartWallPower extends BasePower{
    public static final String POWER_ID = makeID(HeartWallPower.class.getSimpleName());

    public HeartWallPower(AbstractCreature owner,int amount) {
        super(POWER_ID, PowerType.DEBUFF, false, owner, amount);
        updateDescription();
    }

    public void afterEndOfTurn() {
        int block=AbstractDungeon.player.currentBlock;
        if(block>= HeartWall.LOSE_HP_AMOUNT){
            flash();
            for(int i=0;i<amount;i++) {
                addToBot(new DamageAction(AbstractDungeon.player, new DamageInfo(AbstractDungeon.player
                        , block/HeartWall.LOSE_HP_AMOUNT, DamageInfo.DamageType.HP_LOSS), AbstractGameAction.AttackEffect.SLASH_HORIZONTAL));
            }
        }
    }

    @Override
    public void updateDescription() {
        this.description = DESCRIPTIONS[0] + this.amount + DESCRIPTIONS[1];
    }


}
